<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/taglibs.jsp"%>
<!doctype html>
<html>
<head>

    <meta charset="UTF-8">  
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="${ctx}/resources/semanticui/semantic.min.css" rel="stylesheet" type="text/css" />
    <link href="${ctx}/resources/apps.css" rel="stylesheet" type="text/css" />
    <title>候选人信息</title>
    
</head>
<style>
    img { width: 100%; }
    body{
        background-color: #F8F8F8;
    }
    .ui.segment {
        background-color: #F8F8F8;
    }
    .container{
        position: relative;
        top: -2rem;
        background-color: #F8F8F8;
        margin-left: auto;
        margin-right: auto;
        width: 84%;
        text-align: left;
        border: none;
        border-radius: 5px;

    }

    .person_info{
        padding: 10px 5px 0 5px;
        font-weight: bold;
        font-size: 15px;
        line-height: 25px;
        background-color: white;
        color: #275eac;
        border-radius:5px;

    }
    .recom{
        font-weight: bold;
        font-size: 15px;
        line-height: 25px;
        color: #197EC6;
    }
    .box{
        background-color: white;
        padding: 0 5px 0 5px
    }
    .divider{

        border-bottom: solid 1px #CCCCCC;
        line-height: 35px;
    }
    .feedBack{
        margin-top: 2em;
        margin-left: 2%;
        margin-right: 2%;

    }
    .resume_file{
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
        display: inline;
    }


    .left{
        width:20px;
        height:10px;
        float: left;
        font-style:normal;
    }
    .left img{
        max-width:100%;
        min-height:100%;
    }
    .right{
        width:180px;
        height:100%;
        float: right; /* bfc模块触发 */
        display: inline;
        verflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap
    }
    .middle{
        width: auto;
        height: 100%;
        overflow:hidden;  /* bfc模块触发，如过取消将出现文字环绕效果 */
        display: inline;
        padding: 0 8px;
        verflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap
    }
    .recom_info{
        margin: 18px 0 3px 0;
        padding: 5px;
        background: white;
        border: 0px solid;
        border-radius: 5px;
    }




</style>
<body>
<div>
    <img src="${ctx}/resources/images/trend.jpg">
</div>
<div class="container">
    <div class="person_info">
        基本信息
    </div>
<!-- 所在城市  现任职位   工作状态+电话（电话一栏用***表示，包括自荐，猎头推荐及系统匹配）+推荐人&nbsp;<br/> -->
    <div class="box">

        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/candidate.png" style="margin-bottom:-3px"></div>
            <div class="right">
                <c:choose>
                    <c:when test="${recommend.status == 0 || recommend.status == 6}">
                        ***
                    </c:when>
                    <c:otherwise>
                        ${person.name}
                    </c:otherwise>
                </c:choose>
            </div>
            <div class="middle"><label>姓&nbsp;&nbsp;名：</label></div>


        </div>

        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/1.jpg" style="margin-bottom:-3px"></div>
            <div class="right"><c:choose>
                <c:when test="${person.companyId == 0 }">
                    ${person.companyName}
                </c:when>
                <c:otherwise>
                    ${company.name}
                </c:otherwise>
            </c:choose></div>
            <div class="middle">现任公司：</div>


        </div>

        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/2.jpg" style="margin-bottom:-3px"></div>
            <div class="right">${person.roleName}</div>
            <div class="middle">现任职位：</div>
        </div>
        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/3.jpg" style="margin-bottom:-3px"></div>
            <div class="right">
                <c:choose>
                    <c:when test="${person.cityId == 0 }">
                        ${person.cityName}
                    </c:when>
                    <c:otherwise>
                        ${city.name}
                    </c:otherwise>
                </c:choose>
            </div>
            <div class="middle">所在城市：</div>


        </div>
        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/4.jpg" style="margin-bottom:-3px"></div>
            <div class="right">${person.bestdomain}</div>
            <div class="middle">负责区域：</div>

        </div>
        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/5.jpg" style="margin-bottom:-3px"></div>
            <div class="right">${person.workage}年</div>
            <div class="middle">工作年限：</div>

        </div>


        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/6.jpg" style="margin-bottom:-3px"></div>
            <div class="right"><c:if test="${employee != null && employee.expectJobName != null}">
                ${employee.expectJobName}
            </c:if></div>
            <div class="middle">期望职位：</div>

        </div>


        <div class="divider">
            <div class="left"><img src="${ctx}/resources/images/icons/7.jpg" style="margin-bottom:-3px"></div>
            <div class="right"><c:choose>
                <c:when test="${recommend.status != 0 && recommend.status != 6}">
                    ${person.phone}
                </c:when>
                <c:otherwise>
                    ********
                </c:otherwise>
            </c:choose></div>
            <div class="middle">联系方式：</div>

        </div>
<%--        <div class="divider">--%>
<%--            <div class="left"><img src="${ctx}/resources/images/icons/8.jpg" style="margin-bottom:-3px"></div>--%>
<%--            <div class="right"><c:choose>--%>
<%--                <c:when test="${fn:length(employee.comment)>0}">--%>
<%--                    ${employee.comment}--%>
<%--                </c:when>--%>
<%--                <c:otherwise>暂无</c:otherwise>--%>
<%--            </c:choose></div>--%>
<%--            <div class="middle">特别介绍：</div>--%>

<%--        </div>--%>
        <div  style="line-height:35px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">
            <div class="left">
                <img src="${ctx}/resources/images/icons/9.jpg" style="margin-bottom:-3px"></div>
            <div class="right">
                <c:choose>
                    <c:when test="${file != null && recommend.status != 0 && recommend.status != 6}">
                        <c:choose>
                            <c:when test="${fn:indexOf(file.relative_path,'http')>0}">
                                <a target="_blank" href="${file.relative_path}">${file.original_name}</a>
                            </c:when>
                            <c:when test="${'pdf'.equals(file.file_type) }">
                                <a target="_blank" href="https://tnl.oss-cn-shanghai.aliyuncs.com/doc/${file.docId}.pdf">${file.original_name}</a>
                            </c:when>
                            <c:otherwise>
                                <a onclick="viewResume('${file.docId}')">${file.original_name}</a>
                            </c:otherwise>
                        </c:choose>
                    </c:when>
                    <c:otherwise>
                        暂无
                    </c:otherwise>
                </c:choose>
            </div>
            <div class="middle">简历信息：</div>


        </div>


    </div>

    <div class="recom_info">
        <div class="right" >
            <span class="recom_type">
                <c:choose>
                    <c:when test="${recommend.personId == recommend.createby}">
                        自荐
                    </c:when>
                    <c:when test="${recommend.personId != recommend.createby}">
                        他荐
                    </c:when>
                    <c:otherwise>
                        系统推荐
                    </c:otherwise>
                </c:choose>
            </span>
        </div>
        <div class="middle" style="font-size: 15px;font-weight: bold">推荐方式：</div>
    </div>

    <div class="recom_info">
        <div class="right" >
            <c:choose>
                <c:when test="${fn:length(interviews)>0}">
                    <span class="recom_type">
                            ${interviews[0].remark}
                    </span>
                </c:when>
                <c:otherwise>
                    请点击下面按钮进行反馈
                </c:otherwise>
            </c:choose>
        </div>
        <div class="middle"  style="font-size: 15px;font-weight: bold">投递反馈：</div>
    </div>






    <div class="feedBack">

        <div class="recom_status">
            <c:choose>
                <c:when test="${recommend.status > 0 }">
                    <c:if test="${fn:length(interviews)==0}">
                        <div class="ui segment " id="btn-next2">
                            <div class="fluid ui inverted button" id="self"
                                 style="padding-top: 1.0rem;padding-bottom: 1.0rem;width:48%;float:left; display:inline;background-color: #01b3d1;">
                                不合适
                            </div>
                            <div class="fluid ui button"  id="other"
                                 style="padding-top: 1.0rem;padding-bottom: 1.0rem;width:48%;float:right; display:inline;background-color: #01b3d1;">
                                合适</div>
                        </div>
                    </c:if>


                </c:when>
                <c:otherwise>
                    <div class="ui segment" id="cont-next">
                        <div class="fluid ui button send" style="padding-top: 1.0rem;padding-bottom: 1.0rem;float:left; display:inline;background-color: #01b3d1;border-radius: 5px" id="send">发送职位沟通邀请</div>
                    </div>
                </c:otherwise>
            </c:choose>
        </div>
    </div>


<%--    <h3 class="ui attached header" id="list-title">--%>
<%--        面试记录--%>
<%--    </h3>--%>
<%--    &nbsp;<br>--%>
<%--    <div class="ui attached segment" id="list-items">--%>

<%--    <c:forEach items="${interviews}" var="iv">--%>
<%--        <div class="ui segment listitem">--%>
<%--            <c:choose>--%>
<%--                <c:when test="${(iv.round == 6)}">--%>
<%--                    面试进展： 终面 </br>--%>
<%--                </c:when>--%>
<%--                <c:otherwise>--%>
<%--                    面试进展： ${iv.round}面</br>--%>
<%--                </c:otherwise>--%>
<%--            </c:choose>--%>
<%--            面试时间： ${iv.interviewDate}<br>--%>
<%--            结果：--%>
<%--            <c:choose>--%>
<%--                <c:when test="${(iv.status ==1)}">--%>
<%--                    已发面试邀请--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==2)}">--%>
<%--                    建议继续面试--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==3)}">--%>
<%--                    拒绝--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==4)}">--%>
<%--                    录用--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==6)}">--%>
<%--                   未录用--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==7)}">--%>
<%--                    候选人拒绝--%>
<%--                </c:when> --%>
<%--                 <c:when test="${(iv.status ==8)}">--%>
<%--                    候选人不合格--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==9)}">--%>
<%--                    薪资没谈拢--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==10)}">--%>
<%--                    入职--%>
<%--                </c:when> --%>
<%--                <c:when test="${(iv.status ==11)}">--%>
<%--                    未入职--%>
<%--                </c:when> --%>
<%--                <c:otherwise>--%>
<%--                    奖金已发放--%>
<%--                </c:otherwise>--%>
<%--            </c:choose>    --%>
<%--            <br>--%>
<%--            <a href="toInterviewRecord.do?interviewId=${iv.id}">反馈</a>--%>
<%--        </div>--%>
<%--    </c:forEach>--%>
<%--    <br>--%>
<%--        <c:choose>--%>
<%--            <c:when test="${recommend.status > 0 }">--%>
<%--                <h3 class="ui attached header" id="list-title2" style="margin-top: 30px;">--%>
<%--                    面试安排--%>
<%--                </h3>--%>
<%--                <div class="ui attached segment" id="list-items3">--%>
<%--                    <form class="ui form">--%>
<%--                        <div class="field">--%>
<%--                            <label>面试进展</label>--%>
<%--                            <div class="ui input">--%>
<%--                                <select name="round" id="round">--%>
<%--                                    <option value="1">1面</option>--%>
<%--                                    <option value="2">2面</option>--%>
<%--                                    <option value="3">3面</option>--%>
<%--                                    <option value="4">4面</option>--%>
<%--                                    <option value="5">5面</option>--%>
<%--                                    <option value="6">终面</option>--%>
<%--                                </select>--%>
<%--                            </div>--%>
<%--                        </div>--%>
<%--                        <div class="field">--%>
<%--                            <label>面试时间</label>--%>
<%--                            <div class="ui input">--%>
<%--                                <input type="date" name="interviewDate" id="interviewDate" style="width:45%;" placeholder="请选择面试时间" value="${interview.interviewDate}">--%>
<%--                                <span id="sel_start" style="display:flex;">--%>
<%--						   <input type="hidden" id="sel_s_hour" value="${s_hour}"/>--%>
<%--						   <select name="s_hour" id="s_hour">--%>
<%--						        <option value="08" selected>08</option>--%>
<%--						        <option value="09">09</option>--%>
<%--						        <option value="10">10</option>--%>
<%--						        <option value="11">11</option>--%>
<%--						        <option value="12">12</option>--%>
<%--						        <option value="13">13</option>--%>
<%--						        <option value="14">14</option>--%>
<%--						        <option value="15">15</option>--%>
<%--						        <option value="16">16</option>--%>
<%--						        <option value="17">17</option>--%>
<%--						        <option value="18">18</option>--%>
<%--						        <option value="19">19</option>--%>
<%--						        <option value="20">20</option>--%>
<%--						    </select>--%>
<%--						    <select name="s_minute" id="s_minute">--%>
<%--						    	<option value="00" selected>00</option>--%>
<%--						        <option value="10">10</option>--%>
<%--						        <option value="20">20</option>--%>
<%--						        <option value="30">30</option>--%>
<%--						        <option value="40">40</option>--%>
<%--						        <option value="50">50</option>--%>
<%--						    </select>--%>
<%--						    </span>--%>
<%--                            </div>--%>
<%--                        </div>--%>
<%--                        <div class="field">--%>
<%--                            <label>面试地点</label>--%>
<%--                            <div class="ui input">--%>
<%--                                <input type="text" name="interviewSite" id="interviewSite" placeholder="请输入面试地点" value="${interview.interviewSite}">--%>
<%--                            </div>--%>
<%--                        </div>--%>
<%--                        <div class="field">--%>
<%--                            <label>面试官信息</label>--%>
<%--                            <div class="ui input">--%>
<%--                                <input type="text" name="interviewer" id="interviewer" placeholder="请输入面试官信息" value="${interview.interviewer}">--%>
<%--                            </div>--%>
<%--                        </div>--%>
<%--                        <div class="field">--%>
<%--                            <label>面试官联系方式</label>--%>
<%--                            <div class="ui input">--%>
<%--                                <input type="text" name="interviewContact" id="interviewContact" placeholder="请输入面试官联系方式" value="${interview.interviewContact}">--%>
<%--                            </div>--%>
<%--                        </div>--%>
<%--                        <div class="ui center aligned segment" id="choice-buttons">--%>
<%--                            <div class="fluid ui button" id="ask">面试邀请</div>--%>
<%--                        </div>--%>
<%--                    </form>--%>
<%--                </div>--%>
<%--            </c:when>--%>
<%--        </c:choose>--%>




    <input type="hidden" name="recommendstatus" id="recommendstatus" value="${recommend.status}" />

</div>
<script src="${ctx}/resources/jweixin-1.0.0.js"></script>
<script src="${ctx}/resources/semanticui/jquery-2.1.4.min.js"></script>
<script src="${ctx}/resources/semanticui/semantic.js" type="text/javascript"></script>
<script type="text/javascript">

wx.config({
    debug: false, 
    appId: "${config.appid}",  
    timestamp: ${config.currenttimestamp},  
    nonceStr: "${config.nonceStr}", 
    signature: "${config.signatureStr}", 
    jsApiList: ['checkJsApi',
        'onMenuShareTimeline',
        'onMenuShareAppMessage',
        'onMenuShareQQ',
        'onMenuShareWeibo',
        'hideOptionMenu']  
});

    var datasource = { 
        // appenddata:function(data) {
        //     var divstring  = '';
        //     divstring += '<div class="ui segment listitem">';
        //     divstring += '日期： ';
        //     divstring += data.updateTime;
        //     divstring += '<br>';
        //     divstring += '类型：';
        //     if(data.itype == 1) {
        //         divstring += '电话面试';
        //     }
        //     else if(data.itype == 2) {
        //         divstring += '公司面试';
        //     }
        //   /*   else if(data.itype == 3) {
        //         divstring += '笔试';
        //     }  */
        //     else if(data.itype == 4) {
        //         divstring += '业务面试';
        //     } else if(data.itype == 5) {
        //         divstring += '人事面试';
        //     } else if(data.itype == 6) {
        //         divstring += '公司终面';
        //     } else{
        //         divstring += '谈薪资';
        //     }
        //     divstring += '<br>';
        //     divstring += '结果：';
        //     if(data.status == 1) {
        //         divstring += '已发面试邀请';
        //     } else if(data.status == 2) {
        //         divstring += '建议继续面试';
        //     } else if(data.status == 3) {
        //         divstring += '拒绝';
        //     } else if(data.status == 4) {
        //         divstring += '录用';
        //     } else if(data.status == 6) {
        //         divstring += '未录用';
        //     } else if(data.status == 7) {
        //         divstring += '候选人拒绝';
        //     } else if(data.status == 8) {
        //         divstring += '候选人不合格';
        //     } else if(data.status == 9) {
        //         divstring += '薪资没谈拢';
        //     } else if(data.status == 10) {
        //         divstring += '入职';
        //     } else if(data.status == 11) {
        //         divstring += '未入职';
        //     }else {
        //         divstring += '奖金已发放';
        //     }
        //     divstring += '<br> 反馈：';
        //     divstring += data.remark;
        //     var newdata = $(divstring);
        //     $('#list-items').append(newdata);
        // },

        postdatare:function(postdata) {
            var postUrl = '${ctx}/wechat/hunter/hr/creatInterview.do?recommendid=' + ${recommend.id};
            alert(postUrl);

            $.ajax({
                url: postUrl,
                type: "POST",
                data: postdata,
                success:function(data, status) {
                    if(data.errorcode == 0 ) {
                        alert("操作成功");
                        var getUrl = '${ctx}/wechat/hunter/toInterview.do?recommendid='+${recommend.id};
                        location.href = getUrl
                    }   else {
                        alert(data.msg);
                    }
                },
                // error: function() {
                //     alert("服务出错，请稍后尝试");
                // }
            });
        },

        askpostData:function(postdata) {
            var postUrl = '${ctx}/wechat/hunter/hr/updateInterviewStatus.do?action=ask&recommendid='+ ${recommend.id};
            var that = this;

            $.ajax({
                url: postUrl,
                type: "POST",
                data: postdata,
                success:function(data, status) {
                    if(data.errorcode == 0 ) {
                        // that.appenddata(postdata);
                        alert("面试创建成功,候选人将收到您此次的面试邀请通知。")
                        var getUrl = '${ctx}/wechat/hunter/hr/toInterview.do?recommendid='+${recommend.id};
                        location.href = getUrl
                    } else {
                        alert(data.msg);
                    }
                },
                // error: function() {
                //     alert("服务出错，请稍后尝试");
                // }
            });
        },

        updateRecord: function (data) {
            var postUrl ='${ctx}/wechat/recommend/updateRemark?recommendid='+ ${recommend.id}+'&personId=${recommend.personId}';
            $.ajax({
                url: postUrl,
                type: "POST",
                data: data,
                success:function(data, status) {
                    if(data.errorcode == 0 || data.errorcode == 2) {
                        alert("操作成功");
                        var getUrl = '${ctx}/wechat/hunter/hr/toInterview.do?recommendid='+${recommend.id};
                        location.href = getUrl
                    } else {
                        alert(data.msg);
                    }
                },
                error: function() {
                    alert("服务出错，请稍后尝试");
                }
            });
        },
        
        bonuspostData:function(postdata) {
            var postUrl ='${ctx}/wechat/hunter/hr/updateInterviewStatus.do?action=bonus&recommendid=' + ${recommend.id};
            var that = this;

            $.ajax({
                url: postUrl,
                type: "POST",
                data: postdata,
                success:function(data, status) {
                    if(data.errorcode == 0 || data.errorcode == 2) {
                        // that.appenddata(data.data);
                        alert("操作成功");
                        var getUrl = '${ctx}/wechat/hunter/hr/toInterview.do?recommendid='+${recommend.id};
                        location.href = getUrl
                    } else {
                        alert(data.msg);
                    }
                },
                error: function() {
                    alert("服务出错，请稍后尝试");
                }
            });
        },


    };

    var handler = {      
        activate: function() { 
            $(this).addClass('active').siblings().removeClass('active');           
            // if($(this).attr('id') == 'next') {
            //
            //     var postData = {};
            //
            //     var status = $("#status").val();
            //     var updatedate = $("#updatedate").val();
            //     var itype = $("#itype").val();
            //     var remark = $("#remark").val();
            //
            //     postData['status'] = status;
            //     postData['updateTime'] = updatedate;
            //     postData['itype'] = itype;
            //     postData['remark'] = remark;
            //
            //     datasource.postdatare(postData);
            //
            // }
            // if($(this).attr('id') == 'bonus') {
            // 	var postData = {};
            //     datasource.bonuspostData(postData);
            // }


            // if($(this).attr('id') == 'ask') {
            //     var time = new Date($("#interviewDate").val());
            //     if (time.getTime()< new Date().getTime()) {
            //         alert("面试时间应设置在当天之后！")
            //     }
            //
            //     var postData = {};
            //     var interviewDate = $("#interviewDate").val()+" "+$("#s_hour").val()+":"+$("#s_minute").val();
            //
            //     var interviewSite = $("#interviewSite").val();
            //     var interviewer = $("#interviewer").val();
            //     var interviewContact = $("#interviewContact").val();
            //     var round = $("#round").val();
            //
            //     postData['interviewDate'] = interviewDate;
            //     postData['interviewSite'] = interviewSite;
            //     postData['interviewer'] = interviewer;
            //     postData['interviewContact'] = interviewContact;
            //     postData['round'] = round;
            //     if(window.confirm("请确保已经和候选人联系候选人约定好面试时间")) {
            //         datasource.askpostData(postData);
            //     }
            //
            // }

            if($(this).attr('id') == 'other') {
                var postData = {};
                postData['remark'] = "合适";
                datasource.updateRecord(postData);
            }
            if($(this).attr('id') == 'self') {
                var postData = {};
                postData['remark'] = "不合适";
                datasource.updateRecord(postData);
            }
        } 
    };

    function viewResume(docId){
        $.ajax({
            url: '${ctx}/wechat/hr/viewResume.do',
            data:{
                'docId': docId
            },
            type: 'POST',
            success: function(data){
                window.location.href = data;
            }
        })
    }
    
    function submitFeedBack(postdata){    	 
	     /*  var remark = $("#remark").val();
	      if(!remark || remark =="") {
	         alert("反馈是必填项");
	         return false;
	       } */

         var postUrl = '${ctx}/wechat/hunter/hr/creatInterview.do?recommendid=' + ${recommend.id};
         var that = this;

         $.ajax({
             url: postUrl,
             type: "POST",
             data: postdata,
             success:function(data, status) {
                 
            	 if(data.errorcode == 0 ) {
            		 // datasource.appenddata(postdata);
            		 // $("#status").val();
                     // $("#updatedate").val();
                     // $("#itype").val();
                     // $("#remark").val();
                     alert("操作成功")
                     var getUrl = '${ctx}/wechat/hunter/hr/toInterview.do?recommendid='+${recommend.id};
                     location.href = getUrl

                 } else {
                     alert(data.msg);
                 }
            	 
             },
         });
    }

    function sendAsk() {
        var getUrl = '${ctx}/wechat/hunter/hr/updateRecomStatus.do?jobId='+${recommend.jobId}+'&recommendId='+${recommend.id}+'&empId='+${recommend.personId}+'&status='+6;
        console.log(getUrl);
        $.ajax({
            url: getUrl,
            type: "GET",
            success: function(data,status) {
                if(data.errorcode==1){
                    alert("已发送沟通邀请，等待候选人回复！")
                    var getUrl = '${ctx}/wechat/hunter/hr/toJobView.do?jobid='+${recommend.jobId};
                    location.href = getUrl;
                }
            }
        });
    }

    $(document).ready(function() {
        $("#send").click(function() {
            sendAsk();
        });

           $(".submitBtn").click(function(){
        	   //提交表单
        	   var postData = {};

               var status = $("#status").val();
               var updatedate = $("#updatedate").val();
               var itype = $("#itype").val();
               var remark = $("#remark").val();

               postData['status'] = status;
               postData['updateTime'] = updatedate;
               postData['itype'] = itype;
               postData['remark'] = remark;

               submitFeedBack(postData);
           });
           //面试邀请
             $("#ask").click(function(){
              var date=$("#interviewDate").val();
              var interviewDate =date+" "+$("#s_hour").val()+":"+$("#s_minute").val();
              var interviewSite = $("#interviewSite").val();
              var interviewContact = $("#interviewContact").val();
              var interviewer = $("#interviewer").val();
              var round = $("#round").val();
              if(!date || date ==""){
            	  alert("请选择面试时间");
        	      return false;
              }
       	      if(!interviewSite || interviewSite =="") {
       	         alert("请输入面试地点");
       	         return false;
       	      } 
       	   	  if(!interviewer || interviewer =="") {
     	         alert("请输入面试联系人信息");
     	         return false;
     	      } 
	       	  if(!interviewContact || interviewContact =="") {
	   	         alert("请输入面试联系人电话");
	   	         return false;
	   	      } 
        	   //提交表单
        	   var postData = {};
           	   console.log(interviewDate);
               postData['interviewDate'] = interviewDate;
               postData['interviewSite'] = interviewSite;
               postData['interviewer'] = interviewer;
               postData['interviewContact'] = interviewContact;
               postData['round'] = round;
                 if(window.confirm("请确保已经和候选人联系候选人约定好面试时间")) {
                     datasource.askpostData(postData);
                 }
           });

           //发放奖金
           $("#bonus").click(function(){
        	   var postData = {};
               datasource.bonuspostData(postData);
           });
           
           $('.dropdown').dropdown({
               fullTextSearch:true,
           });

           $('#other').click(function () {
               var postData = {};
               postData['remark'] = "合适";
               datasource.updateRecord(postData);
           });
        $('#self').click(function () {
            var postData = {};
            postData['remark'] = "不合适";
            datasource.updateRecord(postData);
        })

           var recommendstatus = $('#recommendstatus').val();
           if(recommendstatus == 0) {
               $('#next').addClass('disabled');
               $('#bonus').addClass('disabled');
           }else if(recommendstatus == 2){
                $('#bonus').addClass('disabled');
           }else if(recommendstatus == 6||
        		   recommendstatus == 8||
        		   recommendstatus == 9||recommendstatus == 11){
           	 // $('#next').addClass('disabled');//提交结果
             $('#bonus').addClass('disabled');//发放奖金
             $('#ask').addClass('disabled');//面试邀请--upd by adela 2019/12/24 @pony提出主动应聘的候选人，点击后加载页面均为有面试反馈的页面，且面试反馈记录、面试安排信息填写完成均可提交
           }else if(recommendstatus == 10){
           	 // $('#next').addClass('disabled');
             $('#ask').addClass('disabled');
           }else if(recommendstatus == 1||recommendstatus == 4||recommendstatus == 7){
        	 $('#bonus').addClass('disabled');//发放奖金
              /* $('#ask').addClass('disabled');//面试邀请 */
           }
           
          /*  $("#ask").click(function(){
             $("#list-items3").toggle();
           }); */
           
           var playerQT = document.getElementById("playerQT");  
           $("#playerBtn").bind("click",function(e){  
               var playerUrl = e.target.getAttribute("playerUrl");  
               playerAudio(playerUrl);  
           });  
           function playerAudio(url){  
               var html ="<audio class='icon-audio' id='player' style='margin:0 5px;cursor:pointer;' src='"+url+"' autoplay preload loop controls>播放</audio >";
               playerQT.innerHTML = html;  
           }
            
           wx.ready(function() {
        	   // document.getElementById('player').play();
           		//wx.hideOptionMenu();
           });
    });
    
    
</script>
</body>
</html>